#7-1字母大小写转换
s= input()
l=len(s)
b=[None]*l
for i in range(l):
    if s[i].islower():
        b[i]=s[i].upper()
    elif s[i].isupper():
        b[i]=s[i].lower()
    else:
        b[i]=s[i]
for i in b:
    print(i ,end="")